<template>
  <div class="vux-check-icon" @click="updateValue">
    <!-- <icon type="success" v-show="type === 'default' && value"></icon>
    <icon type="success_circle" v-show="type === 'plain' && value"></icon>
    <icon type="circle" v-show="!value"></icon> -->
    <span v-show="value"><img src="../../assets/images/select_icon.png" /></span>
    <span v-show="!value"><img src="../../assets/images/unselect_icon.png" /></span>
    <span class="noSelect">
      <slot></slot>
    </span>
  </div>
</template>

<script>
export default {
  name: "check-icons",

  methods: {
    updateValue() {
      this.$emit("update:value", !this.value);
    }
  },
  props: {
    value: {
      type: Boolean,
      default: false
    },
    type: {
      type: String,
      default: "default"
    }
  }
};
</script>

<style lang="less">
.vux-check-icon {
  display: inline-block;
}
.vux-check-icon > .noSelect {
  line-height: 23px;
  vertical-align: middle;
  font-size: 0.3467rem;
  font-weight: 400;
  color: rgba(51, 51, 51, 1);
  margin-left: 0.2667rem;
}
.vux-check-icon > span > img {
  width: 0.6133rem;
  height: 0.6133rem;
  float: left;
}
.vux-check-icon > .weui-icon-success:before,
.vux-check-icon > .weui-icon-success-circle:before {
  color: red;
}
</style>
